package com.zhouhong;

public class Main {

    public static void main(String[] args) {
        Array<Integer> arr = new Array<>();
        for (int i = 0; i < 9; i++) {
            arr.addLast(i);
        }
        System.out.println(arr);

        arr.add(2,100);
        System.out.println(arr);

        arr.addFirst(-1);
        System.out.println(arr);

        System.out.println("最后一个元素：" + arr.get(11));

        arr.set(0, 88);
        System.out.println(arr);

        System.out.println("是否包含元素88：" + arr.contains(88));

        System.out.println("元素100的下标为：" + arr.find(100));

        arr.remove(1);
        arr.remove(1);
        arr.remove(1);
        arr.remove(1);
        arr.remove(1);
        arr.remove(1);
        // 达到1/4缩容为1/2
        System.out.println(arr);

    }
}